<div class="layuimini-main">
    <div class="layui-form layuimini-form">
		
        
		<!-- 上部 -->
		<div style="background:#efefef; padding:10px 40px;">
			<div class="layui-inline">
				<strong style="font-size:16px;">嘎嘎 / 男 / 0岁 / 0cm / 0kg</strong>
			</div>
		</div>
		
		<div>
			<!-- 表格：数据表格 -->
			<table class="layui-hide" id="reportList" lay-filter="reportListFilter"></table>
		</div>
		
		<!-- 定义 id="currentTableBar" -->
		<script type="text/html" id="reportListTableBar">
			<a class="layui-btn layui-btn-normal layui-btn-xs data-count-detail" lay-event="report-details">查看检测报告</a>
		</script>
		
		
    </div>
</div>

<script src="lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="lib/jq-module/paigusu.min.js" charset="utf-8"></script>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;
		
		
		//对table进行初始化
		table.render({
			elem: '#reportList', //指定初始化的tableID
			url: 'api/medicalList.json', //请求地址,获取数据，后期将调用controller的接口，获得json数据
			cols: [
				[ //字段，表头
					{type: 'numbers', title: '序号',width: 50},
					{field: 'reportTime',title: '检测时间', align:'center'},
					{field: 'storeName',title: '检测药店', align:'center'},
					{field: 'medicalType',title: '检测类别', align:'center'},
					{title: '操作', toolbar: '#reportListTableBar', align: "center" }
				]
			],
			page: true, //是否显示分页插件
			limits: [5, 10], //定义每页显示多少条记录
			limit: 5, //默认每页 显示15条
			skin: 'line'
		});
		
		
		table.on('toolbar(reportListTableBar)', function(obj) {

			//查看检测报告
			if (obj.event === 'report-details') { // 监听添加操作
				alert('aaaa');
				var content = miniPage.getHrefContent('report-detail.html'); //加载页面
				var openWH = miniPage.getOpenWidthHeight();
				//定义弹出层
				var index = layer.open({
					title: '新增检测者',
					type: 1,
					shade: 0.2,
					maxmin: true, //弹出层，最小化和最大化的按钮
					shadeClose: true, //关闭
					area: [openWH[0]-50 + 'px', openWH[1]-50 + 'px'],
					offset: [openWH[2] + 'px', openWH[3] + 'px'],
					content: content, //弹出层的内容
				});
				
				$(window).on("resize", function() {
					layer.full(index); //对弹出层实现全屏效果
				});
			
			}
		});

    });
</script>